package com.chare.pojo;

import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Data;

/*公共对象*/
@Data
@AllArgsConstructor
public class RespBean {
    private Integer code;//状态码
    private  String message;//提示信息
    private  Object obj; //对象
    //封装成功的返回对象
    public  static RespBean success(String message)
    {
        return  new RespBean(200,message,null);
    }
    //封装成功的返回对象

    public  static  RespBean success(String message,Object obj)

    {
              return  new RespBean(200,message,obj);
    }
    //失败返回结果
    public  static  RespBean error(String message)
    {
        return   new RespBean(500,message,null);
    }
    //失败返回结果
    public  static RespBean error(String message,Object oj)
    {
        return  new RespBean(500,message,oj);
    }
}
